import spreadsheetdb as db
import spreadsheetdb.uoitdoc as doc
import spreadsheetdb.uoitpage as page
from pprint import pprint
import sys

print "Login"
s = db.GoogleSpreadsheet(sys.argv[1], sys.argv[2])

# print "The list of folders"
# pprint(s.folders().keys())

# print "Content of Science Pages"
# pprint(s.listfolder(title='Science Pages'))

print "All the accounts"
acc = doc.listaccounts(s, "0.1")
pprint(acc.keys())

print 'Pages of "template"'

p = doc.loadpages(s, acc['template'])

pprint(p)

print page.make_public_page(p)

